Skip to content

Conversation

tdykstra
Copy link
Contributor

@tdykstra tdykstra commented Feb 25, 2021

Fixes #20585

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good @tdykstra

I had a couple nits and one or two other suggestions.

Once we can see the preview site, I'll give it another look.


A record type is not necessarily immutable. You can declare properties with `set` accessors and fields that aren't `readonly`. But while records can be mutable, they are primarily intended to support immutable data models.

Immutability can be useful when you need a data-centric type to be thread-safe or you're depending on a hash code remaining the same in a hash table. Immutability isn't appropriate for all data scenarios, however. Entity Framework Core 5, for example, doesn't support updating with immutable entity types.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might add that EF expects reference based equality rather than value based equality as well.

@tdykstra
Copy link
Contributor Author

tdykstra commented Mar 3, 2021

Closing and reopening to trigger build

@tdykstra tdykstra closed this Mar 3, 2021
@tdykstra tdykstra reopened this Mar 3, 2021
@tdykstra tdykstra marked this pull request as ready for review March 4, 2021 20:24
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome stuff @tdykstra

I really like the way it came together.

You can :shipit: when ready.

Base automatically changed from master to main March 5, 2021 23:33
@tdykstra tdykstra merged commit 95ae2ad into dotnet:main Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language Reference: Record types

4 participants